package design_pattern

import "fmt"

//https://learnku.com/articles/26820

type Beverage interface {
	describe() string
	cost() int
}
type Coffee struct {
	description string
}

func (c *Coffee) describe() string {
	return c.description
}
func (c *Coffee) cost() int {
	return 1
}

type Mocha struct {
	beverage Beverage
	description string
}

func (m *Mocha) describe() string {
	return fmt.Sprintf("%v,%v",m.description,m.beverage.describe())
}
func (m *Mocha) cost() int {
	return m.beverage.cost()+1;
}